import 'package:json2dart_safe/json2dart.dart';
import 'package:pornhub_app/model/engagement/engagement_model.dart';

class EngagementStationModel {
  int? stationId; //频道id
  String? stationName; //频道名称
  List<EngagementModel>? meetList; //楼凤数据

  EngagementStationModel({
    this.stationId,
    this.stationName,
    this.meetList,
  });

  Map<String, dynamic> toJson() {
    return <String, dynamic>{}
      ..put('stationId', stationId)
      ..put('stationName', stationName)
      ..put('meetList', meetList?.map((v) => v.toJson()).toList());
  }

  EngagementStationModel.fromJson(Map<String, dynamic> json) {
    stationId = json.asInt('stationId');
    stationName = json.asString('stationName');
    meetList = json.asList<EngagementModel>('meetList', EngagementModel.toBean);
  }

  static EngagementStationModel toBean(dynamic json) =>
      EngagementStationModel.fromJson(json);
}
